package ch7.ex2;

import java.lang.reflect.Array;
import java.util.Arrays;

public class ArrTest {

	public static void main(String[] args) {

		Object ar = Array.newInstance(double.class, 20);
		Array.set(ar, 0, 45.6);
		Array.set(ar, 1, 55.6);
		Array.set(ar, 2, 35.6);
		Array.set(ar, 3, 25.6);
		double d3 = (double) Array.get(ar, 2);
		System.out.println("第三个：" + d3);
		double[] d = (double[]) ar;
		System.out.println(Arrays.toString(d));
	}

}
